def write_content(files):
    context = input("请输入你想写的内容：")
    files.write(context)
    files.close()


def open_file():
    filename = "E:\\zhuomian\\project\\python\\py001\\课堂练习\\" + input("请输入你想创建的文件名：") + ".txt"
    files = open(file=filename, mode="a+", encoding="utf-8")
    write_content(files)


if __name__ == '__main__':
    open_file()
